package com.lzh.admin.consumer;

import com.lzh.admin.service.WemediaNewsAutoScanService;
import com.lzh.common.constants.BusinessConstants;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

/**
 * @author lizuhu
 * @description
 * @date 2021/7/1 18:49
 */
@Component
public class MedieaNewsfAutoListener {
    @Autowired
    private WemediaNewsAutoScanService wemediaNewsAutoScanService;
    //监听主题
//    @KafkaListener(topics = BusinessConstants.MqConstants.WM_NEWS_AUTO_SCAN_TOPIC)
//    public void recevieMessage(ConsumerRecord<?,?> record){
//        if(record!=null){
//            String value = (String) record.value();
//            System.out.println(value);
//            try {
//                wemediaNewsAutoScanService.autoScanByMediaNewsId(Integer.valueOf(value));
//            } catch (Exception e) {
//                e.printStackTrace();
//            }
//        }
//    }
}
